<?php
	
	class Search_Model {
			
	public function searchUsername($input) {
		$res = mysql_query("SELECT *
							FROM user
							WHERE username LIKE '%$input%'
							") or die(mysql_error());
		return $res;
	}
	
	public function searchContent($input) {
		$res = mysql_query("SELECT ID
							FROM post
							WHERE title like '%$input%'
					") or die(mysql_error());	
		return $res;
	}
		
	public function searchTag($input) {
		$res = mysql_query("SELECT post_id
							FROM post_tag
							INNER JOIN tag
							ON post_tag.tag_id=tag.ID
							WHERE tag.type like '%$input%'
					") or die(mysql_error());
		return $res;
	}
	
	}


?>